package org.mcflier.appuntamento.io.driver.db.interfaces;

import java.sql.Timestamp;
import java.util.List;

import org.mcflier.appuntamento.data.model.Torrent;
import org.mcflier.appuntamento.data.model.TorrentCategory;
import org.mcflier.appuntamento.data.model.TorrentList;
import org.mcflier.appuntamento.data.model.TorrentSource;
import org.mcflier.appuntamento.io.exception.JDBCConnectionException;
import org.mcflier.appuntamento.io.exception.JDBCStatementException;
import org.mcflier.appuntamento.io.exception.JDBCTransactionException;

public interface IJDBCTorrentDriver {
	
	public boolean addTorrent(Torrent torrent) throws JDBCConnectionException, JDBCStatementException, JDBCTransactionException;
	
	public int addTorrents(TorrentList torrents);
	
	public List<Torrent> getTorrents() throws JDBCConnectionException, JDBCStatementException;
	
	public List<Torrent> getTorrents(TorrentCategory category);
	
	public List<Torrent> getTorrentsFromSource(int source);
	
	public List<Torrent> getTorrentsFromSource(int source, TorrentCategory category);
	
	public List<Torrent> getTorrentsSince(Timestamp since);
	
	public List<Torrent> getTorrentsSince(Timestamp since, TorrentCategory category);
	
	public List<Torrent> getTorrentsFromSourceSince(int source, Timestamp since);
	
	public List<Torrent> getTorrentsFromSourceSince(int source, Timestamp since, TorrentCategory category);
	
	public Torrent getTorrent(int idTorrent) throws JDBCConnectionException, JDBCStatementException;
	
	public Torrent getTorrent(String magnetURI);
	
	public boolean existTorrent(Torrent torrent) throws JDBCConnectionException, JDBCStatementException;
	
	public List<Torrent> existTorrents(List<Torrent> torrents);
	
	public TorrentSource getTorrentSource(int id);
}
